package com.ling.pl.autoproject.definition.entity.model;

import com.ling.pl.core.commons.annotation.Dict;
import com.ling.pl.core.commons.annotation.ModelProperty;

import javax.persistence.Column;

/**
 * 实体属性
 */
public class Property {
    //实体属性信息
    @Column(name = "ENTITY_ID", length = 36)
    @ModelProperty(comment = "实体id")
    String entityId;

    @Column(name = "NAME", length = 150)
    @ModelProperty(comment = "中文名称")
    String name;

    @Column(name = "NAME_I18N", length = 150)
    @ModelProperty(comment = "中文名称")
    String nameI18n;

    @Column(name = "TABLE_NAME", length = 150)
    @ModelProperty(comment = "表/文档/名称", des = "相当于表列明")
    String columnName;

    @Column(name = "nullAble")
    @ModelProperty(comment = "代码名称", des = "对应className,表示类的属性名称")
    Boolean propertyName;

    @Column(name = "PROPERTY_TYPE", length = 150)
    @ModelProperty(comment = "实体类型")
    @Dict(code = "builder.property.propertyType", des = "物理字段[来自当前实体物理表字段],逻辑字段[来自计算式],链接字段[来自关系实体字段]体")
    String propertyType;

    @Column(name = "DATA_TYPE", length = 150)
    @ModelProperty(comment = "实体类型")
    @Dict(code = "builder.property.dataType", des = "文本,指定长度, 长文本 长度1000, 长文本,没有长度限制, html文本,没有长度限制, 整型, 浮点, 数值, 日期时间型, 日期型, 时间型, 是否逻辑, 真假逻辑, 单项选择-数值, 单项选择-文本, 多项选择-数值, 多项选择-文本, 外键值, 外键值文本, 外键值附加数据, 继承属性, 数字串业务标识-数字类型-用户可见, 数字串业务标识-文本类型-用户可见, 全局唯一标识-文本类型-用户不可见, 货币, 货币单位, 出生日期, 电子邮件, 工作流处理状态")
    String dataType;

    @Column(name = "LENGTH_")
    @ModelProperty(comment = "长度")
    Integer length;

    @Column(name = "PRECISION_")
    @ModelProperty(comment = "浮点")
    Integer precision;

    @Column(name = "IS_NULL_ABLE")
    @ModelProperty(comment = "允许为空")
    Boolean isNullAble;

    @Column(name = "IS_KEY")
    @ModelProperty(comment = "主键属性")
    Boolean isKey;

    @Column(name = "IS_MAIN")
    @ModelProperty(comment = "允许为空")
    Boolean isMain;

    @Column(name = "UNIT_", length = 36)
    @ModelProperty(comment = "单位")
    String unit;

    @Column(name = "DEFAULT_VALUE_TYPE", length = 50)
    @ModelProperty(comment = "默认值类型")
    @Dict(code = "builder.property.defaultValueType", des = "用户全局对象,系统全局对象,唯一编码,网页请求,数据对象类型,当前操作用户-编号,当前操作用户-名称,当前时间,当前应用数据,当前用户,当前机构,当前部门")
    String defaultValueType;

    @Column(name = "DEFAULT_VALUE", length = 150)
    @ModelProperty(comment = "属性默认值")
    String defaultValue;

    @Column(name = "KEY_ASSIGNMENTS", length = 150)
    @ModelProperty(comment = "联合键值")
    String keyAssignments;

    @Column(name = "MAIN_STATUS_PROPERTY", length = 150)
    @ModelProperty(comment = "主属性状态")
    String mainStatusProperty;

    @Column(name = "IS_INDEX")
    @ModelProperty(comment = "索引类型属性")
    Boolean isIndex;

    @Column(name = "BASE_TYPE")
    @ModelProperty(comment = "系统保留属性/预定义类型")
    @Dict(code = "builder.property.baseType", des = "逻辑有效标识,建立人,建立时间,更新人,更新时间,组织机构标识,组织结构名称,部门标识,部门名称")
    String baseType;

    @Column(name = "IS_ADD_ABLE")
    @ModelProperty(comment = "允许用户新建-新增")
    Boolean isAddAble;

    @Column(name = "IS_EDIT_ABLE")
    @ModelProperty(comment = "允许用户新建-编辑")
    Boolean isEditAble;

    @Column(name = "DICT_CODE", length = 150)
    @ModelProperty(comment = "系统代码表")
    String dictCode;

    @Column(name = "FORMAT_", length = 150)
    @ModelProperty(comment = "值格式化")
    String format;

    @Column(name = "CASE_TYPE", length = 150)
    @ModelProperty(comment = "字符转换")
    @Dict(code = "builder.property.caseType", des = "转为大写,转为小写")
    String caseType;

    ///todo 插件开发支持
    @Column(name = "BUSINESS_TYPE", length = 150)
    @ModelProperty(comment = "业务标记")
    @Dict(code = "builder.property.businessType", des = "工作流实例标志,工作流步骤值,工作流用户状态,工作流版本,工作流系统状态")
    String businessType;

    @Column(name = "SORT_TYPE", length = 150)
    @ModelProperty(comment = "排序值")
    String sortType;

    @Column(name = "EXPAND_TYPE", length = 150)
    @ModelProperty(comment = "扩展模式")
    @Dict(code = "builder.property.expandType", des = "子系统功能扩展")
    String expandType;

    //基础值规则
    @Column(name = "DUPLICATE_CHECK_TYPE", length = 150)
    @ModelProperty(comment = "扩展模式")
    @Dict(code = "builder.property.duplicateCheckType", des = "不检查,全部检查,非空检查,指定值范围")
    String duplicateCheckType;

    @Column(name = "RANGE_VALUES", length = 150)
    @ModelProperty(comment = "值范围;分割")
    String rangeValues;

    @Column(name = "RANGE_PROPERTY", length = 150)
    @ModelProperty(comment = "范围属性")
    String rangeProperty;

    @Column(name = "RULE_ID", length = 36)
    @ModelProperty(comment = "值规则", des = "常用正则表达式列表CheckRule")
    String ruleId;

    @Column(name = "MAX_LENGTH")
    @ModelProperty(comment = "允许长度")
    Integer maxLength;

    //数据库相关
    @Column(name = "IS_PHYSICAL")
    @ModelProperty(comment = "物理化属性")
    Boolean isPhysical = true;

    @Column(name = "PHYSICAL_FORMAT", length = 150)
    @ModelProperty(comment = "逻辑字段格式")
    String physicalFormat;

    @Column(name = "PHYSICAL_PARAMS", length = 150)
    @ModelProperty(comment = "逻辑属性参数")
    String physicalParams;

    @Column(name = "IS_TEMP")
    @ModelProperty(comment = "支持临时数据")
    Boolean isTemp;

    @Column(name = "VIEW_LEVEL", length = 50)
    @ModelProperty(comment = "视图列级别")
    @Dict(code = "builder.entity.viewLevel", des = "默认(全部数据),2(无行外数据),3关键数据,4个别字段")
    String viewLevel;

    //属性处理逻辑
    @Column(name = "IS_MULTI_FORM")
    @ModelProperty(comment = "多表单识别属性")
    Boolean isMultiForm;

    @Column(name = "IS_PASTE_RESET")
    @ModelProperty(comment = "粘贴重置")
    Boolean isPasteReset;

    @Column(name = "IS_QUERY_OUT")
    @ModelProperty(comment = "查询输出")
    Boolean isQueryOut;

    @Column(name = "IS_QUICK_FILTER")
    @ModelProperty(comment = "启用快速搜索")
    Boolean isQuickFilter;

    @Column(name = "IS_SECURITY")
    @ModelProperty(comment = "启用列权限控制")
    Boolean isSecurity;

    @Column(name = "IS_LINK")
    @ModelProperty(comment = "支持链接属性回写")
    Boolean isLink;

    @Column(name = "IS_AUDIT")
    @ModelProperty(comment = "启用审计")
    Boolean isAudit;

    @Column(name = "AUDIT_FORMAT", length = 150)
    @ModelProperty(comment = "审计信息格式")
    String auditFormat;

    @Column(name = "UPDATE_TYPE", length = 150)
    @ModelProperty(comment = "更新处理模式")
    @Dict(code = "builder.property.updateType", des = "版本叠加,当前日期时间,当前日期")
    String updateType;

    //关系属性
    @Column(name = "REL_ENTITY_ID", length = 36)
    @ModelProperty(comment = "实体关系")
    String relEntityId;

    @Column(name = "REL_PROPERTY", length = 150)
    @ModelProperty(comment = "关系属性")
    String relProperty;

    //数据导入
    @Column(name = "IMPORT_ORDER")
    @ModelProperty(comment = "导入顺序")
    Integer importOrder;

    @Column(name = "IMPORT_KEY", length = 150)
    @ModelProperty(comment = "导入标识")
    String importKey;

    //mock

    @Column(name = "MOCK_DEFAULT_VALUE", length = 150)
    @ModelProperty(comment = "导入标识")
    String mockDefaultValue;

    @Column(name = "MOCK_FORMAT", length = 150)
    @ModelProperty(comment = "mock规则")
    String mockFormat;
}
